/**
 * @author		Sergey Suzdalskiy
 * @e-mail:		sergey.suzdalskiy@gmail.com
 */
package ua.kiev.gcore.ui.controls
{
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.filters.ColorMatrixFilter;
	import flash.filters.GlowFilter;
	import flash.geom.Point;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	
	public class ButtonSprite extends Button {
		
		public var BUTTON_OVER_SCALE:Number;
		
		private var baseSize:Point;
		
		public function ButtonSprite(UID:String, BackGround:DisplayObject, Label:TextField, textValue:String, MouseClickFunction:Function)
		{
			super(UID, BackGround, Label, textValue, MouseClickFunction);
			
			BUTTON_OVER_SCALE = 0;
			
			baseSize = Size;
		}
		
		override public function set Size(value:Point):void{
			super.Size = value;
			baseSize = Size;
		}
		
		override public function set State(value:int):void{
			super.State = value;
			SetBackGroundPosition(new Point(0,0));
			SetBackGroundSize(new Point(baseSize.x, baseSize.y));
			
			if(State == BUTTON_OVER_STATE){
				SetBackGroundPosition(new Point(-BUTTON_OVER_SCALE/2, -BUTTON_OVER_SCALE/2));
				SetBackGroundSize(new Point(baseSize.x + BUTTON_OVER_SCALE, baseSize.y + BUTTON_OVER_SCALE));
			}	
		}	
	}
}